//package com.parking.mgr.useraccount.controller;
//
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.parking.mgr.common.annotion.BusinessLog;
//import com.parking.mgr.common.annotion.LoginAuth;
//import com.parking.mgr.common.annotion.PermissionUrl;
//import com.parking.mgr.common.enums.LogAnnotionOpTypeEnum;
//import com.parking.mgr.common.pojo.page.PageResult;
//import com.parking.mgr.common.pojo.response.Result;
//import com.parking.mgr.useraccount.model.param.BasicRoleAssignParam;
//import com.parking.mgr.useraccount.model.vo.BasicRoleAssignVO;
//import com.parking.mgr.useraccount.service.BasicRoleAssignService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import java.util.Collection;
//import java.util.List;
//
///**
// * @ClassName BasicRoleAssignController
// * @Description 角色可分配角色
// * @Auther: shilintao
// * @Date: 2023/5/30
// */
//@Api(value = "角色可分配角色", tags = {"角色可分配角色"})
//@RequestMapping("/api/basic/roleassign")
//@RestController
//public class BasicRoleAssignController {
//
//    @Resource
//    private BasicRoleAssignService basicRoleAssignService;
//
//    /**
//     * 角色可分配的角色列表
//     *
//     * @param basicRoleAssignParam
//     * @return
//     */
//    @GetMapping("/list")
//    @ApiOperation(value = "角色可分配的角色列表", notes = "角色可分配的角色列表", httpMethod = "GET")
//    @LoginAuth
//    @PermissionUrl
//    public Result<?> list(BasicRoleAssignParam basicRoleAssignParam) {
//        IPage<BasicRoleAssignVO> roleAssignIPageVO = (IPage<BasicRoleAssignVO>) basicRoleAssignService.list(basicRoleAssignParam);
//        List<BasicRoleAssignVO> roleAssignPageList = roleAssignIPageVO.getRecords();
//        PageResult<BasicRoleAssignVO> pageResult = new PageResult((Page) roleAssignIPageVO);
//        return Result.success(roleAssignPageList, pageResult);
//    }
//
//    @GetMapping("/listenable")
//    @ApiOperation(value = "角色可分配的角色列表(启用状态)", notes = "角色可分配的角色列表(启用状态)", httpMethod = "GET")
//    @LoginAuth
//    @PermissionUrl
//    public Result<?> listEnable(BasicRoleAssignParam basicRoleAssignParam) {
//        IPage<BasicRoleAssignVO> roleAssignIPageVO = (IPage<BasicRoleAssignVO>) basicRoleAssignService.listEnable(basicRoleAssignParam);
//        List<BasicRoleAssignVO> roleAssignPageList = roleAssignIPageVO.getRecords();
//        PageResult<BasicRoleAssignVO> pageResult = new PageResult((Page) roleAssignIPageVO);
//        return Result.success(roleAssignPageList, pageResult);
//    }
//
//    /**
//     * 分配角色的可分配角色
//     *
//     * @param basicRoleAssignParam
//     * @return
//     */
//    @PostMapping("/add")
//    @ApiOperation(value = "分配角色的可分配角色", notes = "分配角色的可分配角色", httpMethod = "POST")
//    @BusinessLog(title = "角色的可分配角色_添加", opType = LogAnnotionOpTypeEnum.ADD)
//    @LoginAuth
//    @PermissionUrl
//    public Result<?> add(@RequestBody @Validated(BasicRoleAssignParam.add.class) BasicRoleAssignParam basicRoleAssignParam) {
//        basicRoleAssignService.add(basicRoleAssignParam);
//        return Result.success();
//    }
//    /*@PostMapping("/add")
//    @ApiOperation(value = "添加角色可分配的角色",notes = "添加角色可分配的角色",httpMethod = "POST")
//    @BusinessLog(title = "角色可分配的角色_增加",opType = LogAnnotionOpTypeEnum.ADD)
//    public Result<?> add(@RequestBody @Validated(BasicRoleAssignParam.add.class) BasicRoleAssignParam basicRoleAssignParam){
//        basicRoleAssignService.add(basicRoleAssignParam);
//        return Result.success();
//    }*/
//
//
//    /**
//     * 删除角色可分配的角色
//     *
//     * @param ids
//     * @return
//     */
//    @PostMapping("/delete")
//    @ApiOperation(value = "删除角色可分配的角色", notes = "删除角色可分配的角色", httpMethod = "POST")
//    @BusinessLog(title = "角色可分配的角色_删除", opType = LogAnnotionOpTypeEnum.DELETE)
//    @LoginAuth
//    @PermissionUrl
//    public Result<?> delete(@ApiParam(name = "id", value = "id", required = true)
//                            @RequestParam(name = "id", required = true)
//                            Collection<String> ids) {
//        basicRoleAssignService.delete(ids);
//        return Result.success();
//    }
//
//    /**
//     * 编辑角色可分配的角色
//     *
//     * @param basicRoleAssignParam
//     * @return
//     */
//    @PostMapping("/edit")
//    @ApiOperation(value = "编辑角色可分配的角色", notes = "编辑角色可分配的角色", httpMethod = "POST")
//    @BusinessLog(title = "角色可分配的角色_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
//    @LoginAuth
//    @PermissionUrl
//    public Result<?> edit(@RequestBody @Validated(BasicRoleAssignParam.edit.class) BasicRoleAssignParam basicRoleAssignParam) {
//        basicRoleAssignService.edit(basicRoleAssignParam);
//        return Result.success();
//    }
//
//
//    /**
//     * 根据fkBasicRoleId获取已分配的角色id集合
//     *
//     * @param fkBasicRoleId
//     * @return
//     */
//    @PostMapping("/assignrole")
//    @ApiOperation(value = "获取已分配的角色", notes = "获取已分配的角色", httpMethod = "POST")
//    @BusinessLog(title = "获取已分配的角色")
//    @LoginAuth
//    @PermissionUrl
//    public Result<?> getAssignRoleIdListByRoleId(@ApiParam(name = "fkBasicRoleId", value = "fkBasicRoleId", required = true)
//                                                 @RequestParam(name = "fkBasicRoleId", required = true)
//                                                 String fkBasicRoleId) {
//        List<String> roleAssignIdList = basicRoleAssignService.getAssignRoleIdListByRoleId(fkBasicRoleId);
//        return Result.success(roleAssignIdList);
//    }
//
//
//}
